<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title></title>
  <link rel="stylesheet" href="../../static/css/bootstrap.4.3.1.min.js.css" th:href="@{/css/bootstrap.4.3.1.min.js.css}"/>
  <style>
    a{
      color: #e6e6e6;
      text-decoration: none;
    }

    a:hover {
      color: orange;
      text-decoration: none;
    }

    li{
      width: 300px;
      display: inline;
      margin: 0px 2% 0px 0px;
    }

    .yxy01{
      border-radius: 5px;border: 1px solid #666;
    }
  </style>
</head>
<body>
<div>
  <div class="row">
    <div class="col-sm-12">
      <form action="/selectSemester" method="post">
        <ul style="list-style: none;margin: 10px 0px 10px 0px;padding: 0px">
          <li>
            <button class="btn btn-success " style="height:50px"><a th:href="@{'/semester/insert'}" target="_self" >新增</a></button>
          </li>
          <li>
            <label style="color:#888;">学期：</label>
            <input type="text" name="semesterName" class="yxy01"/>
          </li>
          <li>
            <input class="btn btn-warning" style="color: white;"  type="submit" value="搜索/重置"/><!--根据文本框写入数据，点击一次是搜索，点击第二次就是相当于重置！！-->
          </li>
        </ul>
      </form>
    </div>
  </div>
<!--  <button class="btn btn-info form-control" style="height:50px"><a th:href="@{'/semester/insert'}" target="_self" >新增</a></button>-->
  <table class="table table-striped table-bordered table-hover text-center">
    <thead>
    <tr>
      <th>序号</th>
      <th>学期</th>
      <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="semester:${semester}">
      <td th:text="${semester.id}"></td>
      <td th:text="${semester.semesterName}"></td>
      <td>
        <a class="btn btn-secondary" th:href="@{/semester/edit(id=${semester.id})}" target="_self">更改</a>
        <a class="btn btn-danger" th:href="@{/deleteSemester(id=${semester.id})}">删除</a>
      </td>
    </tr>
    </tbody>
  </table>
</div>
</body>
</html>